/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author lzw
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { downloadByUrl } from '/@/utils/file/download';

const { adminPath } = useGlobSetting();
const { ctxAdminPath } = useGlobSetting();

export interface FtdsZwrcl extends BasicModel<FtdsZwrcl> {
  zwrclSjly?: string; // 数据来源
  zwrclWjmc?: string; // 文件名称
}

export const ftdsZwrclList = (params?: FtdsZwrcl | any) =>
  defHttp.get<FtdsZwrcl>({ url: adminPath + '/operating/ftdsZwrcl/list', params });

export const ftdsZwrclListData = (params?: FtdsZwrcl | any) =>
  defHttp.post<Page<FtdsZwrcl>>({ url: adminPath + '/operating/ftdsZwrcl/listData', params });

export const ftdsZwrclForm = (params?: FtdsZwrcl | any) =>
  defHttp.get<FtdsZwrcl>({ url: adminPath + '/operating/ftdsZwrcl/form', params });

export const ftdsZwrclSave = (params?: any, data?: FtdsZwrcl | any) =>
  defHttp.postJson<FtdsZwrcl>({ url: adminPath + '/operating/ftdsZwrcl/save', params, data });

export const ftdsZwrclDisable = (params?: FtdsZwrcl | any) =>
  defHttp.get<FtdsZwrcl>({ url: adminPath + '/operating/ftdsZwrcl/disable', params });

export const ftdsZwrclEnable = (params?: FtdsZwrcl | any) =>
  downloadByUrl({ url: ctxAdminPath + '/operating/ftdsZwrcl/enable', params });

export const ftdsZwrclDelete = (params?: FtdsZwrcl | any) =>
  defHttp.get<FtdsZwrcl>({ url: adminPath + '/operating/ftdsZwrcl/delete', params });
